﻿/**
 *
 * active.c
 *
 *  Created on: 2019-10-21
 *      Author: chenshisheng
 */

#include "active.h"

static uint32_t _actionBits;

void Active_Init(void)
{
    _actionBits = 0;
}

void Active_Set(Active_t act, bool isActive)
{
    if(isActive)
    {
        BIT_SET(_actionBits, (uint32_t) (1u << act));
    }
    else
    {
        BIT_CLR(_actionBits, (uint32_t) (1u << act));
    }
}

bool Active_IsSetted(Active_t act)
{
	return (_actionBits & (1UL << act)) != 0;
}

bool Active_HaveAction(void)
{
    return _actionBits ? TRUE : FALSE;
}
